<template>
  <div id="app">
    <AppLayout v-if="shouldShowLayout">
      <router-view />
    </AppLayout>
    <router-view v-else />
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import AppLayout from '@/components/AppLayout.vue'

const route = useRoute()

const shouldShowLayout = computed(() => {
  // 不需要布局的页面（登录、注册等）
  const noLayoutPages = ['/login', '/register']
  return !noLayoutPages.includes(route.path)
})
</script>

<style>
#app {
  height: 100vh;
  width: 100vw;
}
</style>